package hy.service.impl;

import bean.UserAddress;
import com.alibaba.dubbo.config.annotation.Reference;
import hy.service.OrderService;
import org.springframework.stereotype.Service;
import service.UserService;

@Service
public class OrderServiceImpl implements OrderService {
    //@Reference//(loadbalance="roundrobin")//从zk中读取UserService服务的信息
    @Reference(timeout = 3000,retries = 3)
    //@Reference(version = "*")
    //@Reference(stub = "hy.service.impl.UserServiceStub",url="192.168.184.100:20880")//下面service是UserServiceStub类型
    //@Reference(url="192.168.0.180:20880")
    UserService service;

    @Override
    public UserAddress initOrder(String userId) {
        UserAddress addr=service.getUserAddress(userId);
        System.out.println(addr);
        return addr;
    }
}
